//    Copyright (C) Kherty.  All rights reserved.
using System.Collections.Generic;
using OpenLS.Core.Serialization;

namespace OpenLS.Spreadsheet
{
    static class PageBreaks
    {
        internal static void WriteBreaks (List<Break> breaks, WriteContext c, string name)
        {
            if (breaks != null && breaks.Count > 0)
            {
                using (var rowBreaks = c.Write(name))
                {
                    rowBreaks.SetInteger("count", breaks.Count);
                    rowBreaks.SetInteger("manualBreakCount", Enumerable.Count(breaks, cc => cc.Manual));
                    rowBreaks.WriteElements(breaks);
                }
            }

        }

	
    }
}
